
from flask import Flask,render_template,request,flash

app = Flask(__name__)

@app.route('/')
def index():
    return render_template("index.html")
@app.route('/login',methods=["GET","POST"])
def login():
    if request.method=="GET":
        return render_template("login.html")
    if request.method=="POST":
        username=request.form.get("username")
        password=request.form.get("password")

        if (username=="张三" and password=="123456"):
            flash("登录成功")
            return render_template("login.html")
        else:
            flash("登录失败")
        return render_template("login.html")


if __name__ == '__main__':
    print("aaaa")
    app.run(port="8080",debug=True)
